<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNodesTable extends Migration
{
    /**
     * 权限表 节点表
     */
    public function up()
    {
        Schema::create('nodes', function (Blueprint $table) {
            $table->bigIncrements('id');
            //名称
            $table->string('name',50)->comment('名称');
            // nullable 可以为空
            $table->string('route_name',100)->nullable()->default('')->comment('路由别名/权限认证');
            $table->unsignedBigInteger('pid')->default(0)->comment('上级菜单');
            $table->enum('is_menu',['0','1'])->default('0')->comment('是否是菜单0否1是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nodes');
    }
}
